package com.anzia.demo08;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *@ClassName SimpleDateFormat
 *@Description
 *@Author Anzia.
 *@Date 2021/4/11 19:47
 *@Version 1.0
 **/
public class SimpleDateFormat_Demo {
    public static void main(String[] args) throws ParseException {
        //SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
        SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd");

        Date date = new Date();

        String s = format.format(date);
        System.out.println(s);


        Date parse = format.parse("1998/12/13");
        System.out.println(parse);
    }
}
